package com.example.delish.ui.launcher

import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.compose.foundation.Image
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.material.MaterialTheme
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.painterResource
import com.example.delish.R
import com.example.delish.model.LaunchDestination
import com.example.delish.ui.main.launchMainActivity
import com.example.delish.ui.onboarding.launchOnBoardingActivity
import com.example.delish.ui.theme.DelishComposeTheme
import com.example.delish.ui.util.checkAllMatched
import dagger.hilt.android.AndroidEntryPoint

@AndroidEntryPoint
class LauncherActivity : ComponentActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContent {
            DelishComposeTheme {
                LauncherView(
                    onLauncherComplete = { destination ->
                        when (destination) {
                            LaunchDestination.MAIN_ACTIVITY -> launchMainActivity(context = this)
                            LaunchDestination.ON_BOARDING -> launchOnBoardingActivity(context = this)
                        }.checkAllMatched
                        finish()
                    }
                )
            }
        }
    }
}